home *** CD-ROM | disk | FTP | other *** search
/ Amiga Plus 1998 #3 / Amiga Plus CD - 1998 - No. 3.iso / pd / spiele / frotz / source / amiga.h < prev    next >
C/C++ Source or Header  |  1997-11-06  |  5KB  |  167 lines

  1. /*
  2.  * amiga.h
  3.  *
  4.  */
  5.  
  6. #include <diskfont/diskfont.h>
  7. #include <dos/dos.h>
  8. #include <intuition/classusr.h>
  9.  
  10. /* Preferences */
  11.  
  12. struct Preferences
  13. {
  14.   unsigned char        Version;
  15.   unsigned char        CustomScreen;
  16.   unsigned long        ScreenMode;
  17.   unsigned short    Colour;
  18.   char            TextFontName[MAXFONTNAME];
  19.   unsigned short    TextFontSize;
  20.   char            FixedFontName[MAXFONTNAME];
  21.   unsigned short    FixedFontSize;
  22. };
  23.  
  24. struct MorePreferences
  25. {
  26.   char            ScreenFontName[MAXFONTNAME];
  27.   unsigned short    ScreenFontSize;
  28.   unsigned long        Flags;
  29.   short            Window[4];
  30.   unsigned short    Colours[4];
  31.   unsigned short    LeftMargin,RightMargin;
  32.   unsigned short    V6Style;
  33. };
  34.  
  35. #define COLOUR_NONE        0x00
  36. #define COLOUR_BZ_ONLY        0x01
  37. #define COLOUR_ALL_GAMES    0x02
  38. #define COLOUR_BZ_AND_V6    0x03
  39.  
  40. #define V6_NORMAL        0x00
  41. #define V6_640200        0x01
  42.  
  43. #define PREFS_SAVE_WINDOW    (1<<0)
  44. #define PREFS_JUSTIFICATION    (1<<1)
  45. #define PREFS_CENTRE_WINDOW    (1<<2)
  46. #define PREFS_ITALIC        (1<<3)
  47. #define PREFS_ALLFREQ        (1<<4)
  48. #define PREFS_NO_V6_TITLE    (1<<5)
  49.  
  50. /* Games List */
  51.  
  52. #define MAX_GAME_ENTRIES 128
  53.  
  54. struct GameNode
  55. {
  56.   struct Node Node;
  57.   char Author[256];
  58.   int Release[MAX_GAME_ENTRIES];
  59.   int Serial[MAX_GAME_ENTRIES];
  60.   int Checksum[MAX_GAME_ENTRIES];
  61. };
  62.  
  63. #define PORTSIG(port) (1<<((struct MsgPort *)(port))->mp_SigBit)
  64. #define MAX(a,b) (((a) > (b)) ? (a) : (b))
  65. #define MIN(a,b) (((a) < (b)) ? (a) : (b))
  66.  
  67. /* amiga.c prototypes */
  68.  
  69. void SafeRectFill(struct RastPort *rp,long xMin,long yMin,long xMax,long yMax,unsigned long pen);
  70. void FlushText(void);
  71. int GetKey(UWORD *qualifier_addr);
  72. void DrawCursor(int under);
  73. void ShowAbout();
  74. int CharLength(int c);
  75. void MoveTextRow(int offset,int max);
  76. void CursorLeftEnd(unsigned char *buffer,int *pos);
  77. void CursorRightEnd(unsigned char *buffer,int *pos);
  78. int FitTextLine(unsigned char *pointer,int new);
  79. void Quit(int code);
  80. void StartTimer(int timeout);
  81. void StopTimer(void);
  82. void StoreInHistory(unsigned char *line);
  83. int SafeCmp(const char *a,const char *b);
  84. void PutIntoBuffer(unsigned char *buffer,unsigned char *new,int *pos,int max_size);
  85. void RedrawLine(unsigned char *buffer,int *pos,int max_size);
  86. int ProcessMenus(UWORD menu_number);
  87. int Terminate(unsigned char *buffer,int pos,int c,int pen);
  88. void HelpGuide(void);
  89. int InitializeSound(void);
  90. void ResetSound(void);
  91. void SetupSoundDirectory(void);
  92. BPTR LockSoundData(int number);
  93. void WaitForMsg(struct MsgPort *port);
  94. void BusyPointer(struct Window *window,int busy);
  95. LONG Requester(struct Window *window,UBYTE *text,UBYTE *gadgets,...);
  96. void CloseDisplay(void);
  97. void GetScreenRatio(struct Screen *screen);
  98. void SaveCursorPosition();
  99. void RestoreCursorPosition();
  100. void SetScreenDimensions(void);
  101. void SetColourScheme(int custom);
  102. void LimitWindow(int limit,int x);
  103. void GetCursorPos(int *row,int *col);
  104. int SafeTryOpen(char *path,char *ext,BPTR *handle);
  105. void LoadGraphicsFile(void);
  106. int ByteSwap(unsigned short n);
  107. char *FindPicture(int pic);
  108. ULONG GetColour32(ULONG col);
  109. void FreePenTable(void);
  110. struct TextFont *OpenCorrectFont(struct TextAttr *textAttr);
  111. int SizeGadgetHeight(struct Screen *screen);
  112. void SetZColours(void);
  113.  
  114. /* amiga_list.c prototypes */
  115.  
  116. int ScanForGame(int release,char *serial,int checksum);
  117. int CompareGames(int r1,int r2,int s1,int s2,int c1,int c2);
  118. char *GetGameTitle(int game);
  119. char *GetGameAuthors(int game);
  120. char *GetGameLevel(int game);
  121. int SerialNumber(char *serial_string);
  122. void ReadGamesFile(void);
  123. void WriteGamesFile(void);
  124.  
  125. /* amiga_prefs.c prototypes */
  126.  
  127. int OpenPreferences(void);
  128. int GetPreferences(int permanent, char *prefsfile);
  129. void GetScreenMode(void);
  130. void GetFont(char *name,unsigned short *size,int fixed);
  131. void SetFontNames(void);
  132. void AddToDirList(char *entry);
  133. void GetDirList(struct List **list,Object *listview);
  134. void SetDirList(struct List *list,Object *listview,ULONG how);
  135. struct Library *CheckBGUIOpen(void);
  136. void CloseBGUI(int action);
  137. void ClearWindow(struct Window **window_ptr,Object **object_ptr);
  138. void ClearObject(Object **object_ptr);
  139. int SizeX(int x);
  140. int SizeY(int y);
  141. void LoadPreferences(int first);
  142. void SavePreferences(char *name);
  143. void LoadPrefsList(BPTR file, struct List *list,int first);
  144. void SavePrefsList(BPTR file,struct List *list);
  145. LONG BGUIRequester(Object *window,UBYTE *text,UBYTE *gadgets,...);
  146. struct List *CreateList(struct List **list);
  147. void DeleteList(struct List **list,BOOL all,HOOKFUNC hook);
  148. struct Node *CreateNode(struct List *list,char *name,int size);
  149. void ChangeColours(void);
  150. BPTR OpenPrefs(int first);
  151.  
  152. /* amiga_start.c prototypes */
  153.  
  154. void GetGameFilename(void);
  155. int ScanSearchDirectories(void);
  156. void ScanDirectory(BPTR dir);
  157. int TestDirectory(BPTR lock);
  158. void AddGameList(char *game,BPTR dir);
  159. int RequestGame(struct Window *window);
  160. void CreateFoundNode(int game_number,BPTR dir,char *file,char *header);
  161. void DeleteFoundNode(struct Node *node);
  162. int OpenStartWindow(void);
  163. void CloseStartWindow(void);
  164. void HandleStartWindow(void);
  165. void RemoveDuplicateEntries(void);
  166. void SortEntries(void);
  167.